package net.techwatch.jpa.entity;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.JoinColumn;
import javax.persistence.OneToOne;

@Entity
public class Customer extends Person{

	private Employee contactFirst;
	private Employee contactLast;
	private boolean onHold;
	
	public Customer() {
		// nothing to do
	}

	/**
	 * @return the contactFirst
	 */
	@OneToOne
	@JoinColumn(name="CONTACT_FIRST", referencedColumnName="PERSON_ID", nullable=false)
	public Employee getContactFirst() {
		return contactFirst;
	}

	/**
	 * @param contactFirst the contactFirst to set
	 */
	public void setContactFirst(Employee contactFirst) {
		this.contactFirst = contactFirst;
	}

	/**
	 * @return the contactLast
	 */
	@OneToOne
	@JoinColumn(name="CONTACT_LAST", referencedColumnName="PERSON_ID", nullable=false)
	public Employee getContactLast() {
		return contactLast;
	}

	/**
	 * @param contactLast the contactLast to set
	 */
	public void setContactLast(Employee contactLast) {
		this.contactLast = contactLast;
	}

	/**
	 * @return the onHold
	 */
	@Column(name="ON_HOLD", nullable=false)
	public boolean isOnHold() {
		return onHold;
	}

	/**
	 * @param onHold the onHold to set
	 */
	public void setOnHold(boolean onHold) {
		this.onHold = onHold;
	}
}
